package db.pojo;

import java.util.*;
import java.text.SimpleDateFormat;
import db.ext.EaiconExt;
@SuppressWarnings("unchecked")
/**
 * eaicon
 */
public class Eaicon {
	/**
	 * ICONID
	 */
	public String iCONID;
	/**
	 * FILENAME
	 */
	public String fILENAME;
	/**
	 * CSSNAME
	 */
	public String cSSNAME;
	SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
	public static EaiconExt DB = new EaiconExt(); 
	
	public Eaicon() {
		super();
	}
	
	public Eaicon(String iCONID, String fILENAME, String cSSNAME) {
		super();
		this.iCONID = iCONID; 
		this.fILENAME = fILENAME; 
		this.cSSNAME = cSSNAME; 
	}
	
	public String getICONID() {
		return iCONID;
	}

	public void setICONID(String iCONID) {
		this.iCONID = iCONID;
	} 
	
	public String getFILENAME() {
		return fILENAME;
	}

	public void setFILENAME(String fILENAME) {
		this.fILENAME = fILENAME;
	} 
	
	public String getCSSNAME() {
		return cSSNAME;
	}

	public void setCSSNAME(String cSSNAME) {
		this.cSSNAME = cSSNAME;
	} 
	
	
	public Map eaiconToMap() {
		Map map = new HashMap();
		try {
			map.put("iCONID",this.iCONID);
			map.put("fILENAME",this.fILENAME);
			map.put("cSSNAME",this.cSSNAME);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return map;
	}

	public Eaicon mapToEaicon(Map map){
		try {
			String iCONID =  map.get("iCONID").toString();
			String fILENAME =  map.get("fILENAME").toString();
			String cSSNAME =  map.get("cSSNAME").toString();
			Eaicon eaicon = new Eaicon(iCONID, fILENAME, cSSNAME);
			return eaicon;
		} catch (Exception e) {
			e.printStackTrace();
			return null;
		}
	} 
	
	public String toString(){
		return eaiconToMap().toString();
	}
	
	//方便数据操作	
	public Eaicon insert(){
		return DB.insert(this);
	}
}
